package com.mao.crowd.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author maomeng
 * @create 2021-06-21- 14:00
 */
@Configuration
public class CrowdWebMvcConfig implements WebMvcConfigurer {
    /**
     * 跳转注册页面的配置类
     * @param registry
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

        // 浏览器访问的地址
        String urlPath = "/auth/member/to/reg/page.html";
        // 目标视图的名称,用来拼接yml配置中thymeleaf的前后缀
        String viewName = "member-reg";
        registry.addViewController(urlPath).setViewName(viewName);
        // 前往登录页面
        registry.addViewController("/auth/member/to/login/page.html").setViewName("member-login");
        // 前往用户中心页面
        registry.addViewController("/auth/member/to/center/page.html").setViewName("member-center");
        registry.addViewController("/member/my/crowd").setViewName("member-crowd");
    }
}
